<#macro paginate currentPage totalPage actionUrl urlParas="">
	<#if (totalPage <= 0) || (currentPage > totalPage)><#return></#if>
	<#local startPage = currentPage - 4>
	<#if (startPage < 1)><#local startPage = 1></#if>
	
	<#local endPage = currentPage + 4>
	<#if (endPage > totalPage)><#local endPage = totalPage></#if>
	
	 <ul class="pagination">
			<#if (currentPage <= 8)>
				<#local startPage = 1>
			</#if>
			<#if ((totalPage - currentPage) < 8)>
				<#local endPage = totalPage>
			</#if>
			
			<#if (currentPage == 1)>
				 <li  class="paginate_button previous disabled">
                            <a href="#" data-dt-idx="0" tabindex="0">上页</a>
                  </li>
			<#else>
				 <li  class="paginate_button previous">
                            <a href="${actionUrl}#{currentPage - 1}${urlParas!}" data-dt-idx="0" tabindex="0">上页</a>
                  </li>
			</#if>
			
			<#if (currentPage > 8)>
				 <li class="paginate_button">
                     <a href="${actionUrl}#{1}${urlParas!}" data-dt-idx="1" tabindex="0">#{1}</a>
                 </li>
                 <li class="paginate_button ">
                     <a href="${actionUrl}#{2}${urlParas!}" data-dt-idx="2" tabindex="0">#{2}</a>
                 </li>
                  <li class="paginate_button disabled">
                     <a href="#" data-dt-idx="2" tabindex="0">…</a>
                 </li>
			</#if>
			
			<#list startPage..endPage as i>
				<#if currentPage == i>
					<li class="paginate_button active">
                     <a href="#" data-dt-idx="1" tabindex="0">#{i}</a>
                 	</li>
				<#else>
					<li class="paginate_button">
                     <a href="${actionUrl}#{i}${urlParas!}" data-dt-idx="1" tabindex="0">#{i}</a>
                 	</li>
				</#if>
			</#list>
			
			<#if ((totalPage - currentPage) >= 8)>
				 <li class="paginate_button disabled">
                     <a href="#" data-dt-idx="2" tabindex="0">…</a>
                 </li>
				<li class="paginate_button">
                   <a href="${actionUrl}#{totalPage - 1}${urlParas!}" data-dt-idx="1" tabindex="0">#{totalPage - 1}</a>
               	</li>
               	<li class="paginate_button">
                   <a href="${actionUrl}#{totalPage}${urlParas!}" data-dt-idx="1" tabindex="0">#{totalPage}</a>
               	</li>
			</#if>
			
			<#if (currentPage == totalPage)>
				 <li class="paginate_button next disabled">
                     <a href="#" data-dt-idx="2" tabindex="0">下页</a>
                 </li>
			<#else>
			 	<li class="paginate_button next">
                     <a href="${actionUrl}#{currentPage + 1}${urlParas!}" data-dt-idx="2" tabindex="0">下页</a>
                 </li>
			</#if>
	</ul>
</#macro>